#ifndef _QUEUQ_LINK_H_
#define _QUEUE_LINK_H_

template<class Type>
class queueADT
{
public:
    virtual bool isEmpty()const = 0;
    virtual bool isFull()const = 0;
    virtual void initializeQueue() = 0;
    virtual Type front()const = 0;
    virtual Type back()const = 0;
    virtual void addElem(const Type&) = 0;
    virtual void deleteElem() = 0;
    virtual int queueLen()const = 0;
};

//链表节点
template<class Type>
struct node
{
	Type elem;
	node<Type>* next;
};

template<class Type>
class queueLink:public queueADT<Type>
{
public:
	 bool isEmpty()const ;
	 bool isFull()const ;
	 void initializeQueue() ;
	 Type front()const ;
	 Type back()const ;
	 void addElem(const Type&) ;
	 void deleteElem() ;
	 int queueLen()const ;
	 queueLink();
	 queueLink(const queueLink<Type>&);
	 ~queueLink();
	 const queueLink<Type>& operator=(const queueLink<Type>&);
private:
	node<Type>* head;
	node<Type>* tail;
	int length;
	void copyQueue(const queueLink<Type>&);
};




#endif